#include <stdio.h>
#include <signal.h>
#include <unistd.h>

void print(int signo, siginfo_t *siginfo, void *p)
{
	printf("process ID : %d send the signo : %d , the value is : %d\n",siginfo->si_pid,signo,siginfo->si_value);
}

int main()
{
	struct sigaction action = {};
	action.sa_flags = SA_SIGINFO;	//与第14行配对 
	action.sa_sigaction = print;	
	sigaction(50,&action,NULL);
	sigaction(2,&action,NULL);
	pid_t pid = fork();
	if(pid == 0)
	{
		int i = 0;
		for(; i < 10 ; ++i)
		{
			union sigval v;
			v.sival_int = i ;
			sigqueue(getppid(),50,v);
		}
		sleep(1);
		exit(1);
	}
	while(1);
}
